package controller;

import model.User;
import model.Employee;


public class UserSession {

	private String sessionID = null;
	private User user = null;
	private Employee employee = null;
	private Employee[] subOrdinates = null;

	public String getSessionID() {
		return sessionID;
	}

	public void setSessionID(String sessionID) {
		this.sessionID = sessionID;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Employee getEmployee() {
		return employee;
	}

	public void setEmployee(Employee employee) {
		this.employee = employee;
	}

	public Employee[] getSubOrdinates() {
		return subOrdinates;
	}

	public void setSubOrdinates(Employee[] subOrdinates) {
		this.subOrdinates = subOrdinates;
	}

	public boolean isEmployee() {
		if (user == null)
			return false;
		return user.hasRole("employee");
	}

	public boolean isManager() {
		if (user == null)
			return false;
		return user.hasRole("manager");
	}

	public boolean isAdmin() {
		if (user == null)
			return false;
		return user.hasRole("admin");
	}

}
